<?php 
if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class MY_Controller extends CI_Controller {
	
    public $header = array();
    public $footer = array();
    
	public function __construct(){
		parent::__construct();
		$this->output->set_header('Content-Type:text/html;charset=UTF-8');
	}
    
    public function init(){
        //验证是否登陆
        //权限验证
    }
	
	
	public function header(){
        $this->header = array(
            'url' => 'common/header',
            'data' => [
                    'title' => '测试',
                ],
        );
		$this->load->view($this->header['url'],$this->header['data']);
	}
	
	public function footer(){
        $this->footer = array(
            'url' => 'common/footer',
            'data' => [
                    'title' => '测试',
                ],
        );
		$this->load->view($this->footer['url'],$this->footer['data']);
	}
	
	public function content($filename,$content){
		$this->load->view($filename,$content);
	}
	
	public function render($filename,$content){
		$this -> header();
		$this -> content($filename,$content);
		$this -> footer();
	}
	
}